package com.cy.hui_jie_dan.controller.user.app;

import com.cy.hui_jie_dan.comon.result.PageResult;
import com.cy.hui_jie_dan.comon.result.Result;
import com.cy.hui_jie_dan.popj.dto.taskDTO;
import com.cy.hui_jie_dan.popj.vo.tasksListVO;
import com.cy.hui_jie_dan.service.taskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/tasks")
@Api(tags = "任务管理")
public class taskController {
    @Autowired
    taskService taskservice;
    @ApiOperation("获取任务列表(按分类)")
    @GetMapping("/list")
    public Result<PageResult> tasksList(taskDTO taskDTO){
        PageResult page = taskservice.tasksList(taskDTO);
        return Result.success(page);
    }
    @ApiOperation("任务详情")
    @GetMapping("/newProjectDetail/{id}")
    public Result<tasksListVO> ProjectDetail(@PathVariable int id){
        tasksListVO tasksListVO =taskservice.taskDetail(id);
        return Result.success(tasksListVO);
    }
}
